package com.atguigu.tingshu.common.constant;

public class RedisConstant {
    ///前缀
    //album使用
    public static final String ALBUM_INFO_PREFIX = "album:info:";
    public static final String ALBUM_LOCK_PREFIX = "album:lock:";
    //track使用
    public static final String TRACK_INFO_PREFIX = "track:info:";
    public static final String TRACK_LOCK_PREFIX = "track:lock:";
    //category使用
    public static final String CATEGORY_INFO_PREFIX = "category:info:";
    public static final String CATEGORY_LOCK_PREFIX = "category:lock:";
    //account使用
    public static final String ACCOUNT_LOCK_INFO_PREFIX = "account:lock:info:";
    public static final String ACCOUNT_LOCK_IDEM_PREFIX = "account:lock:idem:";
    public static final String ACCOUNT_DEDUCT_IDEM_PREFIX = "account:deduct:idem:";
    public static final String ACCOUNT_UNLOCK_IDEM_PREFIX = "account:unlock:idem:";
    public static final String ACCOUNT_REFUND_IDEM_PREFIX = "account:refund:idem:";



    ///时间使用，单位：秒
    //尝试获取锁的最大等待时间
    public static final long ALBUM_LOCK_EXPIRE_PX1 = 1;
    //锁的持有时间
    public static final long ALBUM_LOCK_EXPIRE_PX2 = 1;
    public static final long ALBUM_TIMEOUT = 60 * 60;
    // 商品如果在数据库中不存在那么会缓存一个空对象进去，但是这个对象是没有用的，所以这个对象的过期时间应该不能太长，
    // 如果太长会占用内存。
    // 定义变量，记录空对象的缓存过期时间
    public static final long ALBUM_TEMPORARY_TIMEOUT = 10 * 60;

    //尝试获取锁的最大等待时间
    public static final long CACHE_LOCK_EXPIRE_PX1 = 1;
    //锁的持有时间
    public static final long CACHE_LOCK_EXPIRE_PX2 = 1;

    public static final long CACHE_TIMEOUT = 24 * 60 * 60;
    public static final long IDEM_TIMEOUT = 30 * 60;
    public static final long CACHE_STAT_TIMEOUT = 24 * 60 * 60;


    public static final int USER_LOGIN_KEY_TIMEOUT = 60 * 60 * 24 * 100;
    public static final int USER_LOGIN_REFRESH_KEY_TIMEOUT = 60 * 60 * 24 * 365;

    // 商品如果在数据库中不存在那么会缓存一个空对象进去，但是这个对象是没有用的，所以这个对象的过期时间应该不能太长，
    // 如果太长会占用内存。
    // 定义变量，记录空对象的缓存过期时间
    public static final long CACHE_TEMPORARY_TIMEOUT = 10 * 60;
    //  布隆过滤器使用！
    public static final String ALBUM_BLOOM_FILTER = "album:bloom:filter";
    public static final String CACHE_BLOOM_FILTER = "cache:bloom:filter";


    public static final String CACHE_INFO_PREFIX = "cache:info:";
    public static final String CACHE_LOCK_PREFIX = "cache:lock:";
    public static final String TRACK_STAT_LOCK_SUFFIX = "track:stat:lock:";

    //用户登录
    public static final String USER_LOGIN_KEY_PREFIX = "user:login:";
    public static final String USER_LOGIN_REFRESH_KEY_PREFIX = "user:login:refresh:";


    public static final String RANKING_KEY_PREFIX = "ranking:";
    public static final String ALBUM_STAT_END_TIME = "album:stat:endTime";
    public static final String USER_LISTEN_PROCESS_PREFIX = "user:listen:process";
    public static final String USER_TRADE_PREFIX = "user:trade";
    public static final int USER_TRADE_TIMEOUT = 15 * 60;
    public static final int ITEM_TIMEOUT = 15 * 60;
    public static final String ALBUM_ITEM_PREFIX = "album:item";
    public static final String TRACK_ITEM_PREFIX = "track:item";
    public static final String ORDER_STATUS_ITEM_PREFIX = "order:status:item";

}
